<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <title>Title</title>
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
我是回调回来的地址
<script type="text/javascript">
function getParameter(name) {
    var query = window.location.search.substring(1);
    console.log(query)
    var vars = query.split("&");
    for (var i=0;i<vars.length;i++) {
        var pair = vars[i].split("=");
        console.log(pair)
        console.log(pair[0])
        console.log(pair[0]===name)
        if(pair[0] == name){
            console.log("value"+pair[1])
            return pair[1];
        }
    }
    return(false);
}

var code=getParameter("code");
console.log("code："+code)
$.ajax({
    url:"/oauth/token",
    method:"post",
    data:{
        "grant_type":"authorization_code",
        "code":code,
        "client_id":"clientapp",
        "client_secret":"112233",
        "redirect_uri":"http://localhost:18010/o2c.html"
    },
    success:function (d) {
        console.log(d)
    }
})
</script>

</body>
</html>